package icegps.com.bhmap.drawhelp;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

import icegps.com.bhmap.bean.TargetPoint;
import icegps.com.bhmap.view.IMapView;


/**
 * Created by 111 on 2017/12/4.
 */

public class DrawLocation {
    private Paint paint;
    private float cx;
    private float cy;
    private float height;
    private float topRadius;
    private float bottomRadius;
    private IMapView iMapView;
    public DrawLocation(IMapView iMapView) {
        this.iMapView=iMapView;
        paint = new Paint();
        paint.setAntiAlias(true);
        topRadius = 12;
        bottomRadius = topRadius + topRadius / 4;
    }

    /**
     * @param canvas
     */

    public void drawShape(Canvas canvas, TargetPoint targetPoint) {

        cx = (float) (targetPoint.getPointX()*iMapView.getMultiple());

        cy = (float) (targetPoint.getPointY()*iMapView.getMultiple());

        paint.setColor(Color.WHITE);
        canvas.drawCircle(cx, cy, bottomRadius, paint);

        paint.setColor(Color.RED);
        canvas.drawCircle(cx, cy, topRadius, paint);
    }

}

